package com.ding.config;

import org.springframework.boot.autoconfigure.web.ErrorProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration //在这里进行更多相关配置
public class WebConfig implements WebMvcConfigurer{
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		WebMvcConfigurer.super.addInterceptors(registry);
	}
	
	@Bean
	public ErrorProperties errorProperties() {
		return new ErrorProperties();
	}
	
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		WebMvcConfigurer.super.addResourceHandlers(registry);
		//添加静态资源映射  如果在类路径下写classpath前缀,如果在文件系统下写file前缀.可以省略前缀
		//registry.addResourceHandler("/imgs/**").addResourceLocations("file:E:/temp/imgs/");
	}
}